//
//  HTTPManger.h
//  HTTPManger
//
//  Created by Lee on 10/2/13.
//  Copyright (c) 2013 Lee. All rights reserved.
//

#import <Foundation/Foundation.h>
#import  "ASIHTTPRequest.h"
//当前请求的状态
typedef enum {
    ManagerModelStateStarted = 0,
    ManagerModelStateFinished,
    ManagerModelStateFailed
} ManagerModelState;

/*
 通过model对象，找到ASIHTTPRequest，就能找到对应的语句块completionHandler
 */
@interface HTTPMangerModel : NSObject
@property (nonatomic ,copy) ASIHTTPRequest *request;
@property (nonatomic ,copy) void (^completionHandler)(ManagerModelState,ASIHTTPRequest *);
@end

@interface HTTPManger : NSObject<ASIHTTPRequestDelegate>
{
    /*
     void (^completionHandler)(BOOL,NSArray *);等同于
     int i ;
     NSString *str;
     void ：固定的
     (^completionHandler):名称，和i，str一样
     (BOOL,NSArray *)：返回的参数
      void (^completionHandler)(ManagerModelState,ASIHTTPRequest *);
     */
    //保存自定义对象的
    NSMutableArray *dataArr;
}
//单例
+(id)shareHTTPManger;
//传入:url 语句块：completion
-(void)addURL:(NSString *)url  completion:(void (^)(ManagerModelState,ASIHTTPRequest *))completion;

@end
